package com.heima.common.constants;

import com.alibaba.fastjson.JSON;
import com.heima.model.mess.UpdateArticleMess;

public class HotArticleConstants {

    //1.ApLikesBehaviorServiceImpl发送点赞的消息(实时更新文章的点赞数) stream数据聚合(需要先注入kafuka)
//        kafkaTemplate.send(HotArticleConstants.HOT_ARTICLE_SCORE_TOPIC,
//            JSON.toJSONString(mess));
    //发消息给kafka，kafka再发消息给stream，让它聚合数据，然后更新聚合后的数据到redis

    //2.ApReadBehaviorServiceImpl发送消息(实时更新文章的阅读数) stream数据聚合(需要先注入kafuka)
//    UpdateArticleMess mess = new UpdateArticleMess();
//        mess.setArticleId(dto.getArticleId());
//        mess.setType(UpdateArticleMess.UpdateArticleType.VIEWS);
//        mess.setAdd(1);
//        kafkaTemplate.send(HotArticleConstants.HOT_ARTICLE_SCORE_TOPIC,
//            JSON.toJSONString(mess));
    //发消息给kafka，kafka再发消息给stream，让它聚合数据，然后更新聚合后的数据到redis
    public static final String HOT_ARTICLE_SCORE_TOPIC="hot.article.score.topic";
    //HotArticleStreamHandler里的发送消息：.to(HotArticleConstants.HOT_ARTICLE_INCR_HANDLE_TOPIC);
    public static final String HOT_ARTICLE_INCR_HANDLE_TOPIC="hot.article.incr.handle.topic";
}